package br.com.amadeus.android.graphics;

import android.R.integer;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;

public class GraficosAndroidActivity extends ListActivity{
    
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        
        String[] itens = new String[]{"Pizza", "Linear", "Barras Horizontais", "Barras Verticais", "S�ries Lineares"};
        ArrayAdapter<String> menu = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, itens);
        setListAdapter(menu);
    }
    
    protected void onListItemClick(ListView l,View v, int position, long id)
    {
    	switch (position) 
    	{
		case 0:
			
			Intent it0 = new Intent(this, FormPizza.class);
			startActivity(it0);
			break;

		case 1:
			Intent it1 = new Intent(this, FormLinear.class);
			startActivity(it1);
			break;
			
		case 2:
			Intent it2 = new Intent(this, BarrasHorizontais.class);
			startActivity(it2);
			break;

		case 3:
			Intent it3 = new Intent(this, BarrasVerticais.class);
			startActivity(it3);
			break;

		case 4:
			Intent it4 = new Intent(this, SeriesLineares.class);
			startActivity(it4);
			break;
			
		default:
			Toast.makeText(this, "Nenhum valor selecionado", Toast.LENGTH_LONG).show();
			break;
		}
    }
}